<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>示例</title>
		<script>
		window.onload = function() {
		    var Btn = document.getElementsByTagName('input')[0];
		    Btn.onclick = function () {
		        alert('hi，你好');
		    };
		};
		</script> 
	</head>
	<body>
		<input type="button" value="按钮" />
	</body>
</html>

